This calculator will tell you how far is that lightning from you.
Light travels much faster than sound and it can be safely assumed that Light fron lightning comes instantly to us while sound takes some time. Under normal
conditions, the speed of sound is 340 m/s. So,
Distance=340*Time difference between sound and light